<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>主页 | 短信平台</title>
<jsp:include page="/WEB-INF/jsp/common/commonlist.jsp"></jsp:include>
<script type="text/javascript">
	function deleteNotice(id){
		if(confirm("确定要删除吗？")){
			window.location.href = "deleteNotice.do?id=" + id;
		}
		return false;
	}
	function bodyLoad(){
		activeMenuItem("systemSet","listNoticeItem");
	}
</script>
</head>
<body onload="bodyLoad()">
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="sidebar">
    <div id="sidebar-wrapper">
      <!-- Sidebar with logo and menu -->
      <h1 id="sidebar-title"><a href="#">短信平台</a></h1> 
      <!-- Logo (221px wide) -->

      <!-- Sidebar Profile links -->
           <!--  页面左上角的部分 -->
     <%@include file="/WEB-INF/jsp/common/leftTop.jsp" %>
     <!-- 页面左侧菜单部分 -->
     <%@include file="/WEB-INF/jsp/common/menu.jsp" %>
      
    </div>
  </div>
  <!-- End #sidebar -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
 
   <%@ include file="/WEB-INF/jsp/common/top.jsp" %>
    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>公告列表</h3>
        <ul class="content-box-tabs">
        </ul>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
        <form action="#" method="post">
          <table>
            <thead>
              <tr>
                 
                <th>ID</th>
                <th>标题</th>
                <th>是否显示</th>
                <th>创建时间</th>
                <th>操作</th>                
              </tr>
            </thead>
            <tfoot> 
              <tr>
                <td colspan="6">
                  
                  <div class="pagination" style="font-size: 12px;"> 
                  	 <a href="adminNoticeList.do?pageNo=1" title="首页">&laquo; 首页</a>
	                  <a href="adminNoticeList.do?pageNo=${result.previousPage }" title="Previous Page">&laquo; 上一页</a> 
	        						${result.currPage}/${result.pageCount }
	                    <a href="adminNoticeList.do?pageNo=${result.nextPage}" title="下一页">下一页 &raquo;</a>
	                    <a href="adminNoticeList.do?pageNo=${result.pageCount}" title="Last Page">尾页 &raquo;</a> 
                    </div>
                  <!-- End .pagination -->
                  <div class="clear"></div>
                </td>
              </tr>
            </tfoot>
            <tbody>
            	<c:forEach items="${result.result }"  var="notice" >
		              <tr>
		               
		                <td>${notice.id }</td>
		                <td>${notice.title }</td>		 
		                <td>
		                	<c:choose>
		                		<c:when test="${notice.visible  }">显示</c:when>
		                		<c:otherwise>隐藏</c:otherwise>
		                	</c:choose>	                	
		                </td>
		                <td>${notice.createDate}</td>
		                <td >
		                  <!-- Icons -->
		                  <a href="editNotice.do?id=${notice.id}" title="修改">修改 </a>
		                  <c:choose>
		                  	<c:when test="${notice.visible }">
		                  		<a href="hideNotice.do?id=${notice.id}&visible=false" title="隐藏">隐藏 </a>
		                  	</c:when>
		                  	<c:otherwise>
		                  		<a href="hideNotice.do?id=${notice.id}&visible=true" title="隐藏">显示</a>
		                  	</c:otherwise>
		                  </c:choose>
		                   <a href="#"  onclick="deleteNotice(${notice.id})" title="删除">删除 </a>
		              </tr>
                </c:forEach>
            </tbody>
          </table>
         </form>
        </div>
        <!-- End #tab1 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
    <div class="clear"></div>
    <%@ include file="/WEB-INF/jsp/common/copyright.jsp" %>
  </div>
  <!-- End #main-content -->
</div>
</body>
</html>